package Tree;

import java.util.*;

public class AVLTree {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count = 0;
        if (n == 1) {
            count++;
        } else {
            in.nextLine();
            List<Map<Character, Integer>> list = new ArrayList<>();
            while (n > 0) {
                Map<Character, Integer> map = new HashMap<>();
                String s = in.nextLine();
                if (s.length() > 0) {
                    int i = 0;
                    char c = s.charAt(i);
                    map.put(c, 1);
                    i++;
                    while (i < s.length()) {
                        c = s.charAt(i);
                        if (map.containsKey(c)) {
                            Integer num = map.get(c);
                            map.put(c, num+1);
                        } else {
                            map.put(c, 1);
                        }
                        i++;
                    }
                }
                if (equalsMap(map, list)) {
                    list.add(map);
                }
                n--;
            }
            count = list.size();
        }
        System.out.println(count);
    }

    private static boolean equalsMap(Map<Character, Integer> map,
                                     List<Map<Character, Integer>> list) {
        if (list.size() == 0) {
            return true;
        }
        for (int i = 0; i < list.size(); i++) {
            if (map.equals(list.get(i))) {
                return false;
            }
        }
        return true;
    }
}